
public class Subset {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		int noOfElements = Integer.parseInt(args[0]);
		RandomizedQueue<String> queue = new RandomizedQueue<String>();
		String strArray;

		while(!StdIn.isEmpty()){
			strArray = StdIn.readString();
			queue.enqueue(strArray);
			//System.out.println("Enqueued:"+strArray);
		}

		for(int i=0;i<noOfElements;i++){
			System.out.println(queue.dequeue());
		}

	}

}
